<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;

class HomeRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [                                      
            //定义规则
            'homeuserpassword' => 'required',
            'homeuserrepassword' =>'required|same:homeuserpassword',
            'homeuseremail'=> 'required|email',
            'homeusertel'=> 'required',
            'homeusersex'=> 'required' 
        ];
    }

    public function messages()
    {
        return[
        // 定义错误显示
            'homeuserpassword.required'=>'密码不能为空',
            'homeuserrepassword.required'=>'确认密码不能为空',
            'homeuserrepassword.same'=>'两次密码不一致',
            'homeuseremail.required'=>'用户邮箱不能为空',
            'homeuseremail.email'=>'邮箱格式不正确',
            'homeusertel.required'=>'用户审核不能为空',
            'homeusersex.required'=>"Hi boys , Hi girl,  Don't forget  your sex "
        ];
    }


}
